<?php get_header(); ?>
<?php while(have_posts()) : the_post(); ?>
	<article id="content" role="main">
		<header class="entry-header">
			<h1><?php the_title(); ?></h1>
		</header>

		<footer class="entry-meta">
			<span class="category"><?php the_category(', ', ''); ?></span>
			<?php
				if(!wp_is_mobile()) {
					the_tags('<span class="tags">', ', ', '</span>');
				}
			?>
			<time datetime="<?php the_time('c'); ?>" pubdate><?php the_time(get_option('date_format')); ?></time>
			<span class="views"><?php lite_post_views(); ?></span>
			<?php
				if(!wp_is_mobile()) {
					edit_post_link('编辑', '<span class="edit">', '</span>');
				}
			?>
		</footer>

		<div class="entry-content">
			<?php
				dynamic_sidebar('content-before');

				the_content();

				dynamic_sidebar('content-after');
			?>
		</div>
			
		<nav class="nav-single" role="navigation">
			<?php
				$previous_post_link = wp_cache_get($id, 'previous_post_link');
				if(!$previous_post_link) {
					$previous_post_link = get_previous_post_link('<span class="previous-article">上一篇：%link</span>', '%title', true);
					if($previous_post_link) wp_cache_set($id, $previous_post_link, 'previous_post_link');
				}
				echo $previous_post_link;
			?>
			<?php
				$next_post_link = wp_cache_get($id, 'next_post_link');
				if(!$next_post_link) {
					$next_post_link = get_next_post_link('<span class="next-article">下一篇：%link</span>', '%title', true);
					if($next_post_link) wp_cache_set($id, $next_post_link, 'next_post_link');
				}
				echo $next_post_link;	
			?>
		</nav>
	</article>
<?php endwhile; ?>
	
<?php get_footer(); ?>
			

				